package edu.whu.tao.util;

import java.util.List;


/**
 * 
 * <P>通用的返回结果</P>
 * @author 陶焕(13294175866)
 * @date 2016年3月10日 上午11:24:04
 */
public class CommonResult<T> extends BaseObject {

	/**
	 * TODO
	 */
	private static final long serialVersionUID = 1L;

	public static final Integer successCode = 0;
	
	public static final Integer failureCode = -1;
	
	private Integer success = successCode;
	
	private String message;
	
	private T data;
	
	private List<T> datas;
	
	public CommonResult() {
		// TODO Auto-generated constructor stub
	}

	
	public CommonResult(Integer success) {
		super();
		this.success = success;
	}



	public CommonResult(Integer success, String message) {
		super();
		this.success = success;
		this.message = message;
	}

	public CommonResult(Integer success, T data) {
		super();
		this.success = success;
		this.data = data;
	}

	public CommonResult(Integer success, List<T> datas) {
		super();
		this.success = success;
		this.datas = datas;
	}



	public Integer getSuccess() {
		return success;
	}

	public void setSuccess(Integer success) {
		this.success = success;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	public List<T> getDatas() {
		return datas;
	}

	public void setDatas(List<T> datas) {
		this.datas = datas;
	}
	
	
	
}
